import { Component, OnInit, Input } from '@angular/core';
import { DataService } from '../../service/data.service';

@Component({
  selector: 'app-normal-page-card',
  templateUrl: './normal-page-card.component.html',
  styleUrls: ['./normal-page-card.component.css']
})
export class NormalPageCardComponent implements OnInit {
  @Input() dishId: number
  dish: any
  dishImgSrc: string = ''
  constructor(private dataService: DataService) { }

  ngOnInit(): void {
    let that = this
    this.dataService.getDish(this.dishId, dish => that.dish = dish)
    this.dishImgSrc = this.dataService.getImageSrc(this.dishId)
  }
}